From: Jasper St. Pierre Date: Fri, 25 May 2012 23:12:30 +0000 (-0400) Subject: extensionUtils: Don't write to the filesystem on start X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6486 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=feef35a8ca0dbb3e9d6805ba2eeacbdf72d52561;p=gnome-shell.git extensionUtils: Don't write to the filesystem on start Create the potentially empty directory when we need to, not when we don't. https://bugzilla.gnome.org/show_bug.cgi?id=677586 --- diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index 77a49d5b5..24109d571 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -158,12 +158,6 @@ function installImporter(extension) { function init() { let userExtensionsPath = GLib.build_filenamev([global.userdatadir, 'extensions']); userExtensionsDir = Gio.file_new_for_path(userExtensionsPath); - try { - if (!userExtensionsDir.query_exists(null)) - userExtensionsDir.make_directory_with_parents(null); - } catch (e) { - logError(e, 'Could not create extensions directory'); - } } function scanExtensionsInDirectory(callback, dir, type) { diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js index 507fc2c69..f83100daf 100644 --- a/js/ui/extensionDownloader.js +++ b/js/ui/extensionDownloader.js @@ -66,8 +66,15 @@ function gotExtensionZipFile(session, message, uuid) { return; } - let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip'); let dir = ExtensionUtils.userExtensionsDir.get_child(uuid); + try { + if (!dir.query_exists(null)) + dir.make_directory_with_parents(null); + } catch (e) { + logExtensionError('Could not create extension directory'); + } + + let [file, stream] = Gio.File.new_tmp('XXXXXX.shell-extension.zip'); let contents = message.response_body.flatten().as_bytes(); stream.output_stream.write_bytes(contents, null); stream.close(null);